<?php include PATH_TPL."/admin/tpl.header.phtml"?>
<div class="main-container inner">
    <div class="main-content">
        <div class="container-fluid">
            <div class="row bt">
                <div class="col-lg-12 bg">
                    <ol class="breadcrumb">
                        <li class="active">
                            <i class="fa  fa-fw fa-reorder"></i>产品详情
                        </li>
                    </ol>
                </div>
            </div>
            <div id="page-wrapper">
                <div class="container-fluid col-md-7 col-sx-12">
                    <form action="/admin_feedback/edit" method="post" enctype="multipart/form-data">
                    	<?foreach($tDatas as $tRow){?>
                        <div class="form-group">
                            <label for="policyno"><strong>保单号</strong></label></br>
                            <span  name="policyno"><?=$tRow['POLICYNO']?></span>
                        </div>
                        <div class="form-group">
                            <label for="starttime"><strong>保单生效日</strong></label></br>
                            <span  name="starttime"><?=$tRow['STARTTIME']?></span>
                        </div>
                        <div class="form-group">
                            <label for="endtime"><strong>保单截至日</strong></label></br>
                            <span  name="endtime"><?=$tRow['ENDTIME']?></span>
                        </div>
                        <div class="form-group">
                            <label for="insurance_type"><strong>险总名称</strong></label></br>
                            <span  name="product_name"><?=$tRow['product_name']?></span>
						</div>
                        <div class="form-group">
                            <label for="insurance_type"><strong>产品企业信息</strong></label></br>
							保险公司:<input type="text" name="cname" id="cname"value="<?=$tpDatas['BC_NAME']?>" <?php if(!empty($tpDatas['BC_NAME'])){echo 'disabled';}?> placeholder="请输入保险公司名称" style="min-width:200px;">&nbsp;&nbsp;
							所属总公司:<input type="text" name="bcname" id="bcname" value="<?=$tpDatas['COMPANYNAME']?>" placeholder="请输入所属总公司名称" <?php if(!empty($tpDatas['BC_NAME'])){echo 'disabled';}?> style="min-width:200px;">
							<button type="button" id="Btn" style="<?php if(!empty($tpDatas)){echo 'display:none';}?>">确定</button>
						</div>
                        <div>
                            <label for="introduce"><strong>产品介绍</strong></label></br>
                            <span name="introduce" style="width:588px;height:178px"><?=htmlspecialchars_decode($tRow['introduce'])?></span>
                        </div>
                        <?}?>
                       <!-- <input type='hidden' value='<?=$tId?>' name='id'/> -->
                    </form>
                </div>
            </div>
        </div>
        <div class="subviews">
            <div class="subviews-container"></div>
        </div>
    </div>
    <!-- end: PAGE -->
</div>
<!-- end: MAIN CONTAINER -->
<script type="text/javascript" src="/plugins/jquery-ui-1.11.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="/plugins/datetimepicker/js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="/plugins/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
$('.datetimeEnd').datetimepicker({
    language:  'zh-CN',
    weekStart: 1,
    todayBtn:  1,
    autoclose: 1,
    todayHighlight: 1,
    startView: 2,
    minView: 0,
    format:'yyyy-mm-dd hh:ii',
    pickerPosition: "top-right",
    forceParse: 0
});
</script>


<script>
$(function(){
    var options={
        beforeSubmit : showRequest,    // 提交前的回调函数
        success : showResponse,    // 提交后的回调函数
        dataType : "json",    // html（默认）、xml、script、json接受服务器端返回的类型
    }
    function showRequest(formData, jqForm, options){
        return true;
    }
    function showResponse(responseText,statusText){
            cg_alert_edit(responseText,'/admin_feedback','/admin_feedback/edit?id=<?=$tId?>');
    }
    $('#submit').click(function() {
        $('form').ajaxSubmit(options);
        return false;

    });
	//var cname = $('input[name="company"]').value;
	//var bcname = $('input[name="bcompany"]').value;
	var cname = document.getElementById('cname');
	var bcname = document.getElementById('bcname');
	$('#Btn').on('click',function(){
		$.post("/admin_products/edit",{ "cname":cname.value,"bcname":bcname.value },function(obj){alert(obj.msg);location.href="/admin_products"});	

	});
});

</script>
<?php include PATH_TPL."/admin/tpl.footer.phtml"?>
